//
//  File Name   :   Directory.inl
//  Description :   inline Functions.
//  Author      :   William McVicar
//  Mail        :   mcvicar.william@gmail.com
//

inline void Directory::RemoveSubDirectory( i32 _iIndex )
{
	m_Subdirectories.erase( m_Subdirectories.begin() + _iIndex );
}

inline void Directory::RemoveSubDirectory( const c8* _szSubDirectory )
{
	std::string path = m_Path + _szSubDirectory; 
	Directory subDir( path );
	std::vector< Directory >::iterator iter = std::find( m_Subdirectories.begin(), m_Subdirectories.end(), subDir );
	if( iter != m_Subdirectories.end() )
		m_Subdirectories.erase( iter );
}

inline const std::string& Directory::GetPath() const
{
	return m_Path;
}

inline const c8* Directory::GetPathCStr() const
{
	return m_Path.c_str();
}

inline void Directory::SetPath( const std::string& _krNewPath )
{
	m_Path = _krNewPath;
}

inline void Directory::SetPath( const c8* _szNewPath )
{
	m_Path = _szNewPath;
}

inline const std::vector< Directory >& Directory::GetSubDirectories() const
{
	return m_Subdirectories;
}

inline void Directory::GetSubDirectories( std::vector< Directory >& _rSubDirectories )
{
	memcpy( &m_Subdirectories[0], &_rSubDirectories[0], sizeof( Directory ) * m_Subdirectories.size() );
}

